$('#tab_'+type_supply).tabs({
	height: frmHeight-163,
	width: frmWidth-267,
	plain: false,
});

if(type_supply == "supply_motor"){
	$('#tab_'+type_supply).tabs('select','Mutasi Unit Motor');
}else if(type_supply == "supply_toolkit"){
	$('#tab_'+type_supply).tabs('select','Mutasi Unit Motor');
}else if(type_supply == "supply_sparepart"){
	$('#tab_'+type_supply).tabs('select','Mutasi Sparepart');
}else if(type_supply == "supply_generator"){
	$('#tab_'+type_supply).tabs('select','Mutasi Generator');
}else if(type_supply == "supply_promosi"){
	$('#tab_'+type_supply).tabs('select','Mutasi Barang Promosi');
}

$('#tab_'+type_supply).tabs({
		onSelect: function(title){
			switch(title){					
				case 'Mutasi Unit Motor': 
					_post = [{name:'type', value: 'mutasi_unit_motor'}];		
					$('#supply_mutasi_unitmotor').html('');
					$("#supply_mutasi_unitmotor").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_mutasi_unitmotor').removeClass('loading')
						$('#supply_mutasi_unitmotor').html(resp);						
					});	
				break;
				case 'Penerimaan Unit Motor': 
					_post = [{name:'type', value: 'penerimaan_unit_motor'}];		
					$('#supply_penerimaan_unitmotor').html('');
					$("#supply_penerimaan_unitmotor").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penerimaan_unitmotor').removeClass('loading')
						$('#supply_penerimaan_unitmotor').html(resp);						
					});	
				break;
				case 'Penempatan Unit Motor': 
					_post = [{name:'type', value: 'penempatan_unit_motor'}];		
					$('#supply_penempatan_unitmotor').html('');
					$("#supply_penempatan_unitmotor").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penempatan_unitmotor').removeClass('loading')
						$('#supply_penempatan_unitmotor').html(resp);						
					});	
				break;
				case 'Reposisi Unit Motor': 
					_post = [{name:'type', value: 'reposisi_unit_motor'}];		
					$('#supply_reposisi_unitmotor').html('');
					$("#supply_reposisi_unitmotor").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_reposisi_unitmotor').removeClass('loading')
						$('#supply_reposisi_unitmotor').html(resp);						
					});	
				break;
				case 'Mutasi Toolkit': 
					_post = [{name:'type', value: 'mutasi_toolkit'}];		
					$('#supply_mutasi_toolkit').html('');
					$("#supply_mutasi_toolkit").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_mutasi_toolkit').removeClass('loading')
						$('#supply_mutasi_toolkit').html(resp);						
					});	
				break;
				case 'Penerimaan Toolkit': 
					_post = [{name:'type', value: 'penerimaan_toolkit'}];		
					$('#supply_penerimaan_toolkit').html('');
					$("#supply_penerimaan_toolkit").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penerimaan_toolkit').removeClass('loading')
						$('#supply_penerimaan_toolkit').html(resp);						
					});	
				break;
				case 'Penempatan Toolkit': 
					_post = [{name:'type', value: 'penempatan_toolkit'}];		
					$('#supply_penempatan_toolkit').html('');
					$("#supply_penempatan_toolkit").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penempatan_toolkit').removeClass('loading')
						$('#supply_penempatan_toolkit').html(resp);						
					});	
				break;
				case 'Reposisi Toolkit': 
					_post = [{name:'type', value: 'reposisi_toolkit'}];		
					$('#supply_reposisi_toolkit').html('');
					$("#supply_reposisi_toolkit").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_reposisi_toolkit').removeClass('loading')
						$('#supply_reposisi_toolkit').html(resp);						
					});	
				break;
				case 'Mutasi Sparepart': 
					_post = [{name:'type', value: 'mutasi_sparepart'}];		
					$('#supply_mutasi_sparepart').html('');
					$("#supply_mutasi_sparepart").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_mutasi_sparepart').removeClass('loading')
						$('#supply_mutasi_sparepart').html(resp);						
					});	
				break;
				case 'Penerimaan Sparepart': 
					_post = [{name:'type', value: 'penerimaan_sparepart'}];		
					$('#supply_penerimaan_sparepart').html('');
					$("#supply_penerimaan_sparepart").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penerimaan_sparepart').removeClass('loading')
						$('#supply_penerimaan_sparepart').html(resp);						
					});	
				break;
				case 'Penempatan Sparepart': 
					_post = [{name:'type', value: 'penempatan_sparepart'}];		
					$('#supply_penempatan_sparepart').html('');
					$("#supply_penempatan_sparepart").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penempatan_sparepart').removeClass('loading')
						$('#supply_penempatan_sparepart').html(resp);						
					});	
				break;
				case 'Reposisi Sparepart': 
					_post = [{name:'type', value: 'reposisi_sparepart'}];		
					$('#supply_reposisi_sparepart').html('');
					$("#supply_reposisi_sparepart").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_reposisi_sparepart').removeClass('loading')
						$('#supply_reposisi_sparepart').html(resp);						
					});	
				break;
				case 'Mutasi Generator': 
					_post = [{name:'type', value: 'mutasi_generator'}];		
					$('#supply_mutasi_generator').html('');
					$("#supply_mutasi_generator").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_mutasi_generator').removeClass('loading')
						$('#supply_mutasi_generator').html(resp);						
					});	
				break;
				case 'Penerimaan Generator': 
					_post = [{name:'type', value: 'penempatan_generator'}];		
					$('#supply_penerimaan_generator').html('');
					$("#supply_penerimaan_generator").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penerimaan_generator').removeClass('loading')
						$('#supply_penerimaan_generator').html(resp);						
					});	
				break;				
				case 'Penempatan Generator': 
					_post = [{name:'type', value: 'penempatan_generator'}];		
					$('#supply_penempatan_generator').html('');
					$("#supply_penempatan_generator").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penempatan_generator').removeClass('loading')
						$('#supply_penempatan_generator').html(resp);						
					});	
				break;
				case 'Reposisi Generator': 
					_post = [{name:'type', value: 'reposisi_generator'}];		
					$('#supply_reposisi_generator').html('');
					$("#supply_reposisi_generator").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_reposisi_generator').removeClass('loading')
						$('#supply_reposisi_generator').html(resp);						
					});	
				break;
				case 'Mutasi Barang Promosi': 
					_post = [{name:'type', value: 'mutasi_promosi'}];		
					$('#supply_mutasi_promosi').html('');
					$("#supply_mutasi_promosi").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_mutasi_promosi').removeClass('loading')
						$('#supply_mutasi_promosi').html(resp);						
					});	
				break;
				case 'Penerimaan Barang Promosi': 
					_post = [{name:'type', value: 'penempatan_promosi'}];		
					$('#supply_penerimaan_promosi').html('');
					$("#supply_penerimaan_promosi").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penerimaan_promosi').removeClass('loading')
						$('#supply_penerimaan_promosi').html(resp);						
					});	
				break;				
				case 'Penempatan Barang Promosi': 
					_post = [{name:'type', value: 'penempatan_promosi'}];		
					$('#supply_penempatan_promosi').html('');
					$("#supply_penempatan_promosi").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_penempatan_promosi').removeClass('loading')
						$('#supply_penempatan_promosi').html(resp);						
					});	
				break;
				case 'Reposisi Barang Promosi': 
					_post = [{name:'type', value: 'reposisi_promosi'}];		
					$('#supply_reposisi_promosi').html('');
					$("#supply_reposisi_promosi").addClass("loading");
					$.post(host+'supply/gettab/', _post, function(resp) {
						$('#supply_reposisi_promosi').removeClass('loading')
						$('#supply_reposisi_promosi').html(resp);						
					});	
				break;
		}
	}
});

